#!/usr/bin/perl
use strict;
use warnings;

my $increased = 0;
my $old = undef;

sub compare {
    my $arg = $_[0];
    if (!defined $old) {
        printf "%d (N/A no previous value)\n", $arg;
        return $arg;
    }
    printf "%d (%s)\n", $arg, $arg > $old ? 'increased' : $arg < $old ? 'decreased' : 'same';
    $increased += $arg > $old;
    return $arg;
}

foreach (<STDIN>) {
    chomp($_);
    $old = compare($_ + 0);
}

printf "total of %d increases\n", $increased;
